package com.guo.book1.dependencyinversion;

public class Test {
    public static void main(String[] args) {
        // 学习java课程
        ICourse course = new JavaCourse();
        course.study();
        System.out.println("--------------方式一-------------");
        Tom tom = new Tom();
        tom.study(new JavaCourse());
        tom.study(new PythonCourse());
        tom.study(new TypescriptCourse());
        System.out.println("--------------方式二 构造器方式-------------");
        Tom tom2 = new Tom(new JavaCourse());
        tom2.study();
        Tom tom3 = new Tom(new TypescriptCourse());
        tom3.study();

    }
}
